package io.renren.modules.jxgkquestion.controller;



import io.renren.modules.jxgkquestion.entity.ScoreRankEntity;
import io.renren.modules.jxgkquestion.service.ScoreRankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;


@RestController
@RequestMapping("ScoreRank/")
public class ScoreRankController {
    @Autowired
    ScoreRankService scoreRankService;

    @RequestMapping("AmountRank/{subjectName}")
    public List<ScoreRankEntity> amountRank(@PathVariable("subjectName")String subjectName){
       return scoreRankService.findAmountRankBySubjectName(subjectName);
    }
    @RequestMapping("RateRank/{subjectName}")
    public List<ScoreRankEntity> rateRank(@PathVariable("subjectName")String subjectName){
        return  scoreRankService.findRateRankBySubjectName(subjectName);
    }
}
